package com.zjh.r2dbc.repositories;

import com.zjh.r2dbc.entity.Emp;
import com.zjh.r2dbc.entity.EmpVo;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * @Auther: zjh
 * @Date: 2025/11/5 - 11 - 05 - 1:41
 * @Description: com.zjh.r2dbc.respositories
 * @version: 1.0
 */
@Repository
public interface EmpVoRepositories extends ReactiveCrudRepository<EmpVo,Integer> {//那个类，主键类型
    //一对一查询 这种要处理映射
    @Query("SELECT e.*, d.DNAME, d.LOCFROM emp eLEFT JOIN dept d ON e.DEPTNOS = d.DEPTNOS ")
    Flux<EmpVo> findEmpWithDept();
}
